<#
	Set-ExecutionPolicy remotesigned
#>

$allPrcoesses = Get-Process

foreach ($proc in $allPrcoesses) {
    $processId = $proc.id
	$processName = $proc.processName
	
	$commandLineObj = Get-WmiObject Win32_Process -Filter "ProcessId=$processId" | Select-Object CommandLine
	$commandLine = $commandLineObj.CommandLine
	
	if($commandLine -and $commandLine.Contains("kqgis_server_micro_")){
		write-host $processName, $commandLine
		Stop-Process -Id $processId
	}else{
		Write-Host $processName, "no commandline. not kill"
	}
	
}